package com.mybatis.config;

import com.mybatis.binding.MapperStatement;

import java.util.HashMap;
import java.util.Map;

/**
 * @author luoc
 * @version 1.0
 * @date 2021/2/20 11:04
 * @since 1.0
 */
public class Configuration {

    /** 数据库连接信息 */
    private JdbcProperties jdbcProperties;

    /** 执行sql文件 */
    private Map<String, MapperStatement>  mapperStatement =  new HashMap<String,MapperStatement>();

    public JdbcProperties getJdbcProperties() {
        return jdbcProperties;
    }

    public void setJdbcProperties(JdbcProperties jdbcProperties) {
        this.jdbcProperties = jdbcProperties;
    }

    public MapperStatement getMapperStatement(String statement) {
        return mapperStatement.get(statement);
    }

    public void addMapperStatement(MapperStatement statement) {
        mapperStatement.put(statement.getId(),statement);
    }
}
